import logo from './logo.svg';
import './App.css';
import React, { createContext, forwardRef, useCallback, useContext, useDebugValue, useEffect, useState } from 'react';
import { click } from '@testing-library/user-event/dist/click';
import { useMemo,useRef} from 'react';
import { useId } from 'react';


function PasswordField()
{
  const passwordintId=useId()
  console.log('passwordintId',passwordintId);

  return (
    <div>
      <label>
        密码：
        <input
        type='password'
        aria-describedby={passwordintId}
        />
      </label>
      <p id={passwordintId}>
        密码应该包含至少18个字符
      </p>
    </div>
  )


}


function App(){
  


   return (
   <div>
    <h2>输入密码</h2>
       <PasswordField/>
       {/* 这两个id就是独立的 react帮我们生成的id */}

      <h2>确认密码</h2>
      <PasswordField/>
      

   </div>
   )
}

export default App;
